package com.example.wificollector;

import java.util.ArrayList;
import java.util.List;

import android.net.wifi.ScanResult;

import com.example.wificollector.entities.Position;
import com.example.wificollector.entities.SessionTrace;
import com.example.wificollector.entities.SignalStrengthSamples;

public class Parser {

	String folderPath;

	public SessionTrace parseToSessionTrace(List<ScanResult> scanResults, Position position) {
		
		SessionTrace sessiontrace = new SessionTrace();
		sessiontrace.setPosition(position);
		
		
		ArrayList<SignalStrengthSamples> signalStrengthSamples = new ArrayList<SignalStrengthSamples>();
		for(ScanResult result : scanResults)
		{
			SignalStrengthSamples signalStrengthSample = new SignalStrengthSamples();
			signalStrengthSample.setMAC(result.BSSID);
			signalStrengthSample.setName(result.SSID);
			signalStrengthSample.setSignalStrength(result.level);
			signalStrengthSamples.add(signalStrengthSample);
		}

		sessiontrace.setSignalStrengthSamples(signalStrengthSamples);

		
		return sessiontrace;
	}

}
